Known in the art is an internal combustion engine in which an NOx storage catalyst storing NOx when the air-fuel ratio of the exhaust gas is lean and releasing the stored NOx when the air-fuel ratio of the exhaust gas is made rich is arranged in the engine exhaust passage, a hydrocarbon feed valve is arranged in the engine exhaust passage upstream of the NOx storage catalyst, and when releasing the NOx, which was stored in the NOx storage catalyst when the air-fuel ratio of the exhaust gas was lean, from the NOx storage catalyst, the air-fuel ratio of the exhaust gas flowing into the NOx storage catalyst is made rich by injecting hydrocarbons from the hydrocarbon feed valve into the exhaust gas in accordance with the opening timing of the exhaust, valve or the air-fuel ratio of the exhaust gas flowing into the NOx storage catalyst is made rich by performing a post injection which injects fuel into the high temperature and high pressure gas in the combustion chamber before the exhaust valve opens (for example, see PTL 1).